using System;

namespace Pay.Core {
    public class LogisticHelper {
        ///<summary>
        ///物流快递Sign签名
        ///</summary>
        ///<param name="content">内容</param>
        ///<param name="keyValue">Appkey</param>
        ///<returns>DataSign签名</returns>
        public static string encrypt(String content, String keyValue) {
            if (keyValue != null) {
                return base64(SecureHelper.MD5(content + keyValue));
            }
            return base64(SecureHelper.MD5(content));
        }
        /// <summary>
        /// base64编码
        /// </summary>
        /// <param name="str">内容</param>
        /// <returns></returns>
        public static string base64(String str) {
            return Convert.ToBase64String(System.Text.Encoding.GetEncoding("UTF-8").GetBytes(str));
        }
    }
}
